<script type="text/javascript">
$(document).ready(function() {
<?php 
require SVROOT.'Models/Comments_model.php';

$modelName = 'Comments_model';
$this->modelb = new $modelName;
	if(isset($this->all_photo)){
		$col = 1; $row = 1; $count = 1;
		foreach ($this->all_photo as $key => $value) {
			echo 'var className = ".dashboard-col-'. $col . '";';
			echo '$(className).append(\' <div class="dashboard" data-group="AllPhoto" rel="' . $count . '">';
			echo '<div class="block">  : <b>' . $value['Detail'] . '</b><hr> <br> ';
			echo '<img style="width: 345px;display:flex;margin:0px auto;"src="'. URL .$value['Path'].$value['Name'].'"></img>';
			echo '<br> <form class="frm_post_comment" action="'. URL.'Comments/GetCommentsPhoto" method="post" accept-charset="utf-8">';
			$data = $this->modelb->GetCommentsPhoto($value['Id']);
			foreach ($data as $key_1 => $value_1) {
				echo '	 	<div class="comment"> ';
				echo '	 			<input type="hidden" name="IdPhoto" value="'.$value['Id'].'">';
				echo '				<div class="show">';
				echo '					<div class="cm_avatar"></div>';
				echo '					<div class="cm">	';
				echo '						<span>'.$value_1['Name'].'</span>';
				echo '						<span>'.$value_1['Comment'].'</span>';
				echo '					</div>';
				echo '				</div>';
			}
			echo '				<div class="post_cm" >';
			echo '						Role :<select name="role">';
			echo '							<option value="Public">Public</option>';
			echo '							<option value="Private">Private</option>';
			echo '						</select>';
			echo '					<input type="text" class="comm" name="Comment"></input>';
			echo '				</div>';
			echo '			 </div>';
			echo '</div></div>\');';
			if($col < 3) { $col++; }
			else { $col = 1 ; $row++ ;};
			$count++;
		}
	}
	if(isset($this->all_albums)){
		$col = 1; $row = 1; $count = 1;
		foreach ($this->all_albums as $key => $value) {
			echo 'var className = ".dashboard-col-'. $col . '";';
			echo '$(className).append(\' <div class="dashboard" data-group="AllPhoto" rel="' . $count . '"> <div class="block">  : <b>' . $value['Name'] . '</b><hr> <br> <a href="'.URL.'photos/Get_all_photo_in_album/'. $value['AlbumsId'].'"><img style="width: 345px;display:flex;margin:0px auto;" src="'. URL .$value['ImgPath'].$value['ImgName'].'"></img></a><br> Gia tri : </div></div>\');';
			if($col < 3) { $col++; }
			else { $col = 1 ; $row++ ;};
			$count++;
		}
	}
	if(isset($this->all_photo_by_album_id)){
		$col = 1; $row = 1; $count = 1;
		foreach ($this->all_photo_by_album_id as $key => $value) {
			echo 'var className = ".dashboard-col-'. $col . '";';
			echo '$(className).append(\' <div class="dashboard" data-group="AllPhoto" rel="' . $count . '"> <div class="block">  : <b>' . $value['Detail'] . '</b><hr> <br> <img style="width: 345px;display:flex;margin:0px auto;" src="'. URL .$value['Path'].$value['Name'].'"></img><br> Gia tri : </div></div>\');';
			if($col < 3) { $col++; }
			else { $col = 1 ; $row++ ;};
			$count++;
		}
	}


?>
	$('.frm_post_comment').submit(function(){
		return false;
	});
});
</script>

<style>
	.hide {display: none;}
	.comment {
		width: 100%;
		min-height: 235px;
		background: #CCC;
		align-items: baseline;
		vertical-align: top;
		display: flex;
		flex: 0 1 auto;
	}
	.cm {
		width: 100%;
	}
</style>
<div class="page-outer">
	<div class="page-container">
		<div class="dashboard-super-cover">
			<div class="dashboard-cover">
				<div class="block-cover">
					<p> </p>
					<p> </p>
					<p> </p>
					<p> </p>

				</div>
			</div>
		</div>

		<div class="dashboard-spacer">
			<button class="btn_change_html" data-group="profile">profile</button>
			<button class="btn_change_html" data-group="photo">photo</button>
			<button class="btn_change_html" data-group="test"> test</button>
			<button class="btn_change_html" data-group="sothich">sothich</button>
		</div>

<!--
		<div class="dashboard-col-1 a dashboard-col">
			
		</div>


			<div class='dashboard-hot'>
				<div class="block-hot">
					<p>...Profile.......HOT.....</p>
					<p>...Profile.......HOT.....</p>		<div class="dashboard-col-2 dashboard-col">
			<div class="dashboard" > 
				<div class="block">
				<br><br>
				<br><br>
				<br><br>
					danh muc : <b> + data[0] + </b><hr> <br>Row : '+ row + ' Col : '+ col + ' item : '+ item + text+<br> Gia tri : ' +data[1][i]+
				</div>
			</div>
		</div>

		<div class="dashboard-col-3 dashboard-col">
			
		</div>
-->
		<div class="dashboard-hot-col">
					<p>...Profile.......HOT.....</p>
					<p>...Profile.......HOT.....</p>
					<p>...Profile.......HOT.....</p>
				</div>
			</div>
			<div class="clear"></div>
		</div>
		<div class="dashboard-col-1 dashboard-col">
			
		</div>

		<div class="dashboard-col-2 dashboard-col">
			
		</div>

		<div class="dashboard-col-3 dashboard-col">
			
		</div>

		<div class="clear"></div>
	</div>
	<div class="clear"></div>
</div>